package com.wc.blue_bridge_history.Java14B.B_阶乘求和;

/**
 * @Author congge
 * @Date 2024/3/11 9:52
 * @description https://www.lanqiao.cn/paper/3872/problem/3500/
 */
public class Main {
    static long P = (long) 1e10;

    public static void main(String[] args) {
        long num = 1;
        long mul = 1;
        long res = 0;
        for (; num <= 45; num++) {
            mul = mul * num % P;
            System.out.println(mul);
            res = (res + mul) % P;
        }
        System.out.println(res);
    }
}
